<template>
	<div style="width: 375px; position: relative;">
		<img :width="_width" :src="_src" alt="" style="display: block;">
	</div>
</template>
<script>
	import {
		defineComponent
	} from 'vue';
	export default defineComponent({
		name: 'TaImage',
		data() {
			return {

			};
		},
		props: {
			width: String,
			src: String,
			align: String,
		},
		computed: {
			_src() {
				if (this.src) {
					return `${this.src}?x-oss-process=image/resize,w_375`;
				} else {
					return 'https://blkq-static.oss-cn-shenzhen.aliyuncs.com/fenxiao/goods/BB66E66D9E61E55F369C8ED9EEADC57C.jpeg?x-oss-process=image/resize,w_375';
				}
			},
			_width() {
				var width = this.width.replace('rpx', '').replace('px', '').replace('auto', '');
				if (width) {
					return `${width}px`;
				} else {
					return 'auto';
				}
			}
		}
	});
</script>
<style scoped>

</style>
